import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  {
    path: '/',
    redirect: '/home',
    component: () => import('../views/second-route.vue'), // 懒加载
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('../views/home-page.vue') // 懒加载
      },
      {
        path: '/followed',
        name: 'followed',
        component: () => import('../views/followed-page.vue') // 懒加载
      },
      {
        path: '/message',
        name: 'message',
        component: () => import('../views/message-page.vue') // 懒加载
      },
      {
        path: '/my',
        name: 'my',
        component: () => import('../views/my-page.vue') // 懒加载
      }]
  },
  {
    path: '/video',
    name: 'video',
    component: () => import('../views/video-page.vue') // 懒加载
  },
  {
    path: '/profile',
    name: 'profile',
    component: () => import('../views/profile-page.vue') // 懒加载
  },
  {
    path: '/messagefan',
    name: 'messagefan',
    component: () => import('../views/messagefan-page.vue') // 懒加载
  },
  {
    path: '/messagelike',
    name: 'messagelike',
    component: () => import('../views/messagelike-page.vue') // 懒加载
  },
  {
    path: '/messageat',
    name: 'messageat',
    component: () => import('../views/messageat-page.vue') // 懒加载
  },
  {
    path: '/messagecomment',
    name: 'messagecomment',
    component: () => import('../views/messagecomment-page.vue') // 懒加载
  },
  {
    path: '/contact',
    name: 'contact',
    component: () => import('../views/contact-page.vue') // 懒加载
  },
  {
    path: '/interestList',
    name: 'interestList',
    component: () => import('../views/interestList-page.vue') // 懒加载
  },
  {
    path: '/fanList',
    name: 'fanList',
    component: () => import('../views/fanlist-page.vue') // 懒加载
  },
  {
    path: '/chatwith',
    name: 'chatwith',
    component: () => import('../views/chatwith-page.vue') // 懒加载
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router
